package me.khrystal.rxnews.module.news.presenter;

import me.khrystal.rxnews.base.BasePresenterImpl;
import me.khrystal.rxnews.bean.NeteastNewsDetail;
import me.khrystal.rxnews.module.news.model.INewsDetailInteractor;
import me.khrystal.rxnews.module.news.model.INewsDetailInteractorImpl;
import me.khrystal.rxnews.module.news.view.INewsDetailView;

/**
 * usage:
 * author: kHRYSTAL
 * create time: 16/4/28
 * update time:
 * email: 723526676@qq.com
 */
public class INewsDetailPresenterImpl extends BasePresenterImpl<INewsDetailView,NeteastNewsDetail>
    implements INewsDetailPresenter{

    public INewsDetailPresenterImpl(INewsDetailView view,String postId) {
        super(view);
        INewsDetailInteractor<NeteastNewsDetail> newsDetailInteractor = new INewsDetailInteractorImpl();
        mSubscription = newsDetailInteractor.requestNewsDetail(this,postId);
    }

    @Override
    public void requestSuccess(NeteastNewsDetail data) {
        mView.initNewsDetail(data);
    }
}
